package org.sfx.rich

import java.lang.annotation.Annotation
import java.lang.reflect.Constructor
import java.lang.reflect.Type
import org.sfx.rich.Enrich._

case class RichConstructor[T](underlying: Constructor[T]) {
  def parameterTypes: Array[Class[_]] = underlying.getParameterTypes()
  def genericParameterTypes: Array[Type] = underlying.getGenericParameterTypes()
  def exceptionTypes: Array[Class[_]] = underlying.getExceptionTypes()
  def genericExceptionTypes: Array[Type] = underlying.getGenericExceptionTypes()
  def genericString: String = underlying.toGenericString()
  def apply(args: Object*): T = underlying.newInstance(args: _*)
  def isVarArgs: Boolean = underlying.isVarArgs()
  def parameterAnnotations: Array[Array[Annotation]] = underlying.getParameterAnnotations()
}
